appModule.controller(
  'LoginController',
  [
    '$scope', '$rootScope', '$location','PhoneService', 'TransFerence', 'conf', '$sessionStorage',
    function($scope, $rootScope, $location, PhoneService, TransFerence, conf, $sessionStorage) {
      $scope.login = function() {
        var loginJson = TransFerence({mobile:$scope.username, password:$scope.password});
        PhoneService.login.query(loginJson).$promise.then(function(res) {
            $rootScope.menuList = res;
            $rootScope.username = $scope.username;
            $sessionStorage.username = $scope.username;
            $sessionStorage.menuList = res;
            $rootScope.isLogin = true;
            $sessionStorage.isLogin = true;
            $location.url(res[0]['url']);
        });
        // $rootScope.isLogin = true;
        // $location.url('/standby-management');
      }
    },
  ]
);
